<!-- 商品列表组件 <good-list :list="xx"></good-list> -->
<template>
	<view class="list">
		<view class="item" :key="good.testId" v-for="good in list">
			<view class="qs-type">
				<text>{{ good.name }}</text>
				<text style="font-size: 28rpx;">{{ good.category | codeFilter('STU_TEST_CATEGORY') }}</text>
			</view>
			<view v-if="!good.time" class="qs-total">
				<text>题数: {{ good.questionNum }}</text>
				<text>满分: {{ good.total }}</text>
			</view>

			<view v-if="good.time" class="qs-time">提交时间： {{ good.examTime | formatDate }}</view>
			<view v-if="good.time" class="qs-info">
				<text>正确：{{ good.rightSubject }}/{{ good.questionNum }}</text>
				<text>得分：{{ good.hasPoint }}/{{ good.total }}</text>
				<text>耗时：{{ good.time | formatSeconds }}</text>
			</view>
			<view @click="toDetail(good.testId)" class="qs-btg">
				<view class="bt">{{ good.time ? '重新批改' : '批改试卷' }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		list: {
			type: Array,
			default() {
				return [];
			}
		}
	},
	methods: {
		toDetail(id) {
			uni.navigateTo({
				url: '/pages/question/detail/index?id=' + id
			});
		}
	}
};
</script>

<style lang="scss">
.list {
	background-color: #f3f3f3;
	padding-top: 20rpx;
}
.item {
	margin: 0 20rpx 20rpx;
	border-radius: 16rpx;
	padding: 0 30rpx;
	background-color: #fff;
	font-size: 28rpx;
	.qs-type {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 100rpx;
		font-size: 34rpx;

		// padding: 0 30rpx;
	}
	.qs-total {
		font-size: 28rpx;
		text {
			margin-right: 20rpx;
			color: #888888;
		}
		margin-bottom: 20rpx;
	}
	.qs-title {
		padding-top: 20rpx;
		border-top: 1rpx solid #fafafa;
		font-size: 32rpx;
		text {
			color: #fff;
			border-radius: 30rpx;
			margin-left: 10rpx;
			font-size: 26rpx;
			background-color: $uni-color-warning;
			padding: 4rpx 10rpx;
		}
	}

	.qs-time {
		padding-top: 10rpx;
		color: gray;
	}
	.qs-info {
		margin-top: 20rpx;
		display: flex;
		justify-content: space-between;
		margin-bottom: 20rpx;
		color: gray;
	}
	.qs-btg {
		border-top: 1rpx solid #fafafa;
		display: flex;
		justify-content: flex-end;
		height: 120rpx;
		align-items: center;
		.bt {
			color: #fff;
			background-color: #5e8aff;
			border-radius: 20rpx;
			padding: 14rpx 20rpx;
		}
	}
}
</style>
